
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
using namespace std;

template <class T>
std::string to_string(T t, std::ios_base & (*f)(std::ios_base&))
{
  std::ostringstream oss;
  oss << f << t;
  return oss.str();
}

void main()
{
	std::string outBuffer = "";
    std::ostringstream oss;

	unsigned int vv = 31220016;
	oss << vv << ", babo";

	cout << oss.str() << endl;
	outBuffer = oss.str();
	cout << outBuffer << endl;
	cout << "+++++++++" << endl;


	ifstream ifs;
	ifs.open("patch.txt");

	if( ifs.fail() )
	{
		return;
	}

	unsigned int nVersion = 0, nSize = 0;

	while( !ifs.eof() )
	{
		bool result1, result2;

		ifs >> nVersion;
		result1 = ifs.fail();
		ifs >> nSize;
		result2 = ifs.fail();
		
		cout << nVersion << " / " << nSize << endl;
		
		if( result1 && result2 )
			break;
		else if( result1 || result2 )
			cout << "file error..." << endl;
	}
	
	ifs.close();
}